<?php
// $Id: photos.admin.inc,v 1.0 2008/7/23 0:28 east Exp $
function photos_admin_settings() {
	for ($i = 1; $i <= 10; $i++){
		$c[$i] = $i;
	}
    $choice = new stdClass();
	$a = range(0,100,5);
	for ($i = 1; $i <= 20; $i++){
		$choice->option = array($a[$i]=>$a[$i]);
		$cc[] = $choice;
	}
	$form['photos_num'] = array(
	  '#type' => 'select',
	  '#title' => t('Number of upload'),
	  '#default_value' => variable_get('photos_num', 5),
	  '#options' => $c,
	  '#description' => t('Maxium amount allowed for one upload'),
	  '#required' => TRUE,
	);
	$form['photos_pnum'] = array(
	  '#type' => 'textfield',
	  '#title' => t('Number of albums'),
	  '#default_value' => variable_get('photos_pnum', 20),
	  '#description' => t('The number of albums a user allowed to create. Administrater is not limited.',
	  '#required' => TRUE,
	);
	$form['photos_rname'] = array(
	  '#type' => 'radios',
	  '#title' => t('Rename image'),
	  '#default_value' => variable_get('photos_rname', 0),
	  '#description' => t('Rename uploaded image by random numbers, to solve problems with non-ASCII filenames such as Chinese.'),
	  '#options' => array(t('Disable'), t('Enable')),
	);
	$form['photos_t_w'] = array(
		'#type'=> 'textfield',
		'#title' => t('Thumbnail size'),
		'#default_value' => variable_get('photos_t_w', '100x100'),
		'#description' => t('This photos module creates 2 formats of thumbnails, and saves original image. Please set size'),
		'#size' => '10',
	);
	$form['photos_t_s'] = array(
		'#type' => 'select',
		'#title' => t('Thumbnail format'),
		'#default_value' => variable_get('photos_t_s', 'crop'),
		'#options' => array('scale' => t('scale'),'crop' => t('crop')),
		'#description' => t('%scale:Keep ratio for resizing, %crop: Fix size, aligned by a border.', array('%scale' => t('scale'), '%crop' => t('crop')),
	);
	$form['photos_t_ww'] = array(
		'#type'=> 'textfield',
		'#title' => t('Medium image size'),
		'#default_value' => variable_get('photos_t_ww', '640x480'),
		'#description' => t('This photos module creates 2 formats of thumbnails, and saves original image. Please set size'),
		'#size' => '10',
	);
	$form['photos_t_ss'] = array(
		'#type' => 'select',
		'#title' => '中型图样式',
		'#default_value' => variable_get('photos_t_ss', 'scale'),
		'#options' => array('scale' => t('scale'),'crop' => t('crop')),
		'#description' => t('%scale:Keep ratio for resizing, %crop: Fix size, aligned by a border.', array('%scale' => t('scale'), '%crop' => t('crop')),
	);
	$form['photos_path'] = array(
		'#type'=> 'textfield',
		'#title' => t('Path of saving'),
		'#default_value' => variable_get('photos_path', 'photos/image_%uid'),
		'#description' => t('The path where the files should be saved, may save by user id or user name, e.g.: photos/%uid or photos/%username'),
		'#size' => '40',
		'#required' => TRUE,
	);
	return system_settings_form($form);
}
